home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 23 / AACD 23.iso / AACD / Programming / tek / msg / putmsg.c < prev    next >
C/C++ Source or Header  |  2001-05-12  |  618b  |  35 lines

  1.  
  2. #include "tek/msg.h"
  3. #include "tek/kn/exec.h"
  4.  
  5. /* 
  6. **    TEKlib
  7. **    (C) 2001 TEK neoscientists
  8. **    all rights reserved.
  9. **
  10. **    TVOID TPutMsg(TPORT *msgport, TAPTR msg)
  11. **
  12. **    put one-way msg to msgport, unreliable
  13. **
  14. */
  15.  
  16. TVOID TPutMsg(TPORT *msgport, TAPTR mem)
  17. {
  18.     if (msgport && mem)
  19.     {
  20.         TMSG *msg = ((TMSG *) mem) - 1;
  21.  
  22.         msg->replyport = TNULL;
  23.         msg->sender = TNULL;                /* sender is local address space */
  24.  
  25.         msg->status = TMSG_STATUS_SENT | TMSG_STATUS_PENDING;
  26.  
  27.         kn_lock(&msgport->lock);
  28.  
  29.         TAddTail(&msgport->msglist, (TNODE *) msg);
  30.         TSignal(msgport->sigtask, msgport->signal);
  31.  
  32.         kn_unlock(&msgport->lock);
  33.     }
  34. }
  35.